<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>关于book和booklist的栗子</title>
		<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css" />
		<script src="js/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/Underscore-1.8.3min.js"></script>
		<script src="js/backbone.js"></script>
		<script type="text/javascript">
		</script>
	</head>
	<body>
		<script type="text/javascript">
			 var Book=Backbone.Model.extend({
			 	defaults:{
			 		title:"default"
			 	},
			 	initialize:function(){
			 		
			 	}
			 });
			 var BookList=Backbone.Collection.extend({
			 	 model:Book
			 });
			 var book1=new Book({title:'book1'});
			 var book2=new Book({title:'book2'});
			 var book3=new Book({title:'book3'});
			 var booklist=new BookList();
			 booklist.add(book1);
			 booklist.add(book2);
			 booklist.add(book3); 
			 
			 booklist.each(function(book){
			 	console.log(book.get("title"));
			 })
			  
		</script>
	</body>
</html>